{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
    <h3 class="pb-3">短信配置</h3>
    <table class="layui-table layui-table-form">
        <tr>
            <td class="layui-td-gray">accessKeyId</td>
            <td>
                <input type="hidden" value="{$id}" name="id">
                <input type="text"  name="oss_accessKeyId" autocomplete="off" placeholder="请输入accessKeyId" lay-reqText="请输入accessKeyId"
                       class="layui-input" {notempty name="$config.oss_accessKeyId" } value="{$config.oss_accessKeyId}" {/notempty}>
            </td>
        </tr>


        <tr>

            <td class="layui-td-gray-4">accessKeySecret
            </td>
            <td>
                <input type="text" name="oss_accessKeySecret" autocomplete="off" placeholder="请输入accessKeySecret" lay-reqText="请输入accessKeySecret"
                       class="layui-input" {notempty name="$config.oss_accessKeySecret" } value="{$config.oss_accessKeySecret}" {/notempty}>
            </td>
        </tr>

        <tr>

            <td class="layui-td-gray-4">短信模版
            </td>
            <td>
                <input type="text" name="oss_template" autocomplete="off" placeholder="请输入短信模版" lay-reqText="请输入短信模版"
                       class="layui-input" {notempty name="$config.oss_template" } value="{$config.oss_template}" {/notempty}>
            </td>
        </tr>


        <tr>

            <td class="layui-td-gray-4">短信签名
            </td>
            <td>
                <input type="text" name="oss_sign" autocomplete="off" placeholder="请输入短信签名" lay-reqText="请输入短信签名"
                       class="layui-input" {notempty name="$config.oss_sign" } value="{$config.oss_sign}" {/notempty}>
            </td>
        </tr>

    </table>

    <div class="py-3">
        <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
    const moduleInit = ['tool'];
    function gouguInit() {
        var form = layui.form, tool = layui.tool;
        //监听提交
        form.on('submit(webform)', function (data) {
            let callback = function (e) {
                layer.msg(e.msg);
                if (e.code == 0) {
                    parent.layui.tool.close(1000);
                }
            }
            tool.post("/admin/conf/edit", data.field, callback);
            return false;
        });
    }
</script>
{/block}
<!-- /脚本 -->